import 'package:flutter/material.dart';
import 'routes/Routes.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:permission_handler/permission_handler.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Permission.camera.request();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        localizationsDelegates: [
          // ... app-specific localization delegate[s] here
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
        ],
        supportedLocales: [
          const Locale('zh', 'CH'),
          const Locale('en', 'US')
        ],

        // 去掉debug图标
        debugShowCheckedModeBanner: false,
        initialRoute: '/news',
        // home: Tabs(),
        // routes: {
        //   '/form': (context) => FormPage(),
        //   '/search': (context) => SearchPage(),
        // }
        onGenerateRoute: onGenerateRoute);
  }
}
